*Figure 12: Distribution of Responses by Type of Country

use "Data_ImportantProvisions_240423.dta", clear


************************************************************************************************************
*********Functioning Democracies*********
************************************************************************************************************
*Mean
hist mean_func_democ, fraction xtitle("") lcolor(black) xlabel(1 "Very Unimportant" 2 "Somewhat Unimportant" 3 "Neutral" 4 "Somewhat Important" 5 "Very Important", angle(45) labsize(small)) title("Mean") color(navy) saving(mean_func_democ, replace)

*Median
hist median_func_democ, fraction xtitle("") lcolor(black) xlabel(1 "Very Unimportant" 2 "Somewhat Unimportant" 3 "Neutral" 4 "Somewhat Important" 5 "Very Important", angle(45) labsize(small)) title("Median") color(navy) saving(median_func_democ, replace)

*Combining the two
graph combine mean_func_democ.gph median_func_democ.gph, scale(1.35) xsize(3) ysize(1.5)
graph export "Figure_12_A.pdf", replace
************************************************************************************************************
*********New Democracies*********
************************************************************************************************************
*Mean
hist mean_new_democ, fraction xtitle("") lcolor(black) xlabel(1 "Very Unimportant" 2 "Somewhat Unimportant" 3 "Neutral" 4 "Somewhat Important" 5 "Very Important", angle(45) labsize(small)) title("Mean") color(forest_green) saving(mean_new_democ, replace)

*Median
hist median_new_democ, fraction xtitle("") lcolor(black) xlabel(1 "Very Unimportant" 2 "Somewhat Unimportant" 3 "Neutral" 4 "Somewhat Important" 5 "Very Important", angle(45) labsize(small)) title("Median") color(forest_green) saving(median_new_democ, replace)

*Combining the two 
graph combine mean_new_democ.gph median_new_democ.gph, scale(1.35) xsize(3) ysize(1.5)
graph export "Figure_12_B.pdf", replace

************************************************************************************************************
*********Divided Democracies*********
************************************************************************************************************
*Mean
hist median_divided_democ, fraction xtitle("") lcolor(black) xlabel(1 "Very Unimportant" 2 "Somewhat Unimportant" 3 "Neutral" 4 "Somewhat Important" 5 "Very Important", angle(45) labsize(small)) title("Median") color(purple) saving(median_divided_democ, replace)

*Median
hist mean_divided_democ, fraction xtitle("") lcolor(black) xlabel(1 "Very Unimportant" 2 "Somewhat Unimportant" 3 "Neutral" 4 "Somewhat Important" 5 "Very Important", angle(45) labsize(small)) title("Mean") color(purple) saving(mean_divided_democ, replace)

*Combining the two
graph combine mean_divided_democ.gph median_divided_democ.gph, scale(1.35) xsize(3) ysize(1.5)
graph export "Figure_12_C.pdf", replace

erase mean_func_democ.gph 
erase mean_new_democ.gph 
erase mean_divided_democ.gph
erase median_func_democ.gph 
erase median_new_democ.gph 
erase median_divided_democ.gph

